package dongshi.daddy.strategy;

public class PayAmountContext {
    // 依赖倒置原则，面向接口编程
    // 客户端需要设置自己想要使用的具体策略类，因此需要客户端对策略类有具体的了解，这点也是策略设计模式的不足之处
    private PayAmountStrategy payAmountStrategy;

    public PayAmountContext(/*PayAmount payAmount*/) {
        /*this.payAmount = payAmount;*/
    }

    public void setPayAmount(PayAmountStrategy payAmountStrategy) {
        this.payAmountStrategy = payAmountStrategy;
    }

    public double payAmount(Object param) {
        return this.payAmountStrategy.payAmount(param);
    }
}
